package sc.common.origwsdl;

import org.apache.cxf.jaxws.JaxWsServerFactoryBean;

public class ServerStart {

    protected ServerStart() throws Exception {

        HelloWorldImpl helloWorld = new HelloWorldImpl();
        String address = "http://localhost:9000/cxf";
        /**
        * 也可以使用注释的方式发布
        */
        //Endpoint.publish(address, helloWorld);
        //发布服务
        JaxWsServerFactoryBean server = new JaxWsServerFactoryBean();
        server.setServiceClass(helloWorld.getClass());
        server.setAddress(address);
        server.create();
    }

    public static void main(String[] args) throws Exception {
        new ServerStart();
        System.in.read();
    }

}